//
//  WXAnimationManager.h
//  ParentsCommunity
//
//  Created by tianlong on 2018/7/5.
//  Copyright © 2018年 XES. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WXAnimationView.h"

@interface WXAnimationManager : NSObject
+(instancetype)defaultManager;
+(void)playAllAnimations;
+(void)playWithIdentifier:(NSString *)identifier;
+(void)pauseAllAnimations;
+(void)pauseWithIdentifier:(NSString *)identifier;
+(void)stopAllAnimations;
+(void)stopAniamtionWithIdentifier:(NSString *)identifier;
/** 通过唯一标示获取标识对应的动画视图 */
+(WXAnimationView *)getAnimationByIdentifier:(NSString *)identifier;

/**
 配置动画参数
 @param json 动画json
 @param speed 播放速度
 @param repeatCount 重复次数,默认不重复,只播放一次
 @param identifier 动画唯一标识
 @param layout 外界布局,增加这个block的原因:先调播放,在布局动画不能正常结束
 @param autoPlay 是否自动播放
 @param completion 播放完成回调
 */
+(void)playWithJson:(NSString *)json
              speed:(CGFloat)speed
        repeatCount:(NSInteger)repeatCount
         identifier:(NSString *)identifier
             layout:(void (^)(WXAnimationView *aniView))layout
           autoPlay:(BOOL)autoPlay
         completion:(void (^)(BOOL finished))completion;

/**
 配置动画参数,内部布局动画视图
 */
+(void)playWithJson:(NSString *)json
              speed:(CGFloat)speed
        repeatCount:(NSInteger)repeatCount
         identifier:(NSString *)identifier
             inView:(UIView *)inView
           autoPlay:(BOOL)autoPlay
         completion:(void (^)(BOOL finished))completion;
@end
